Load Mermaid/Highlight.js only where used; fix heading hierarchy and image attributes - #882
Merged
Merged
Conversation
…image attributes - Mermaid and Highlight.js are opt-in: they load on pages whose Markdown content has a code block (or `highlight`/`diagram` front matter), with `defer`; site params default to false (#865). - Search index fetch shows a failure message and allows a retry (#861). - Search overlay heading is an h2; homepage and page-builder section titles are h2 under one page h1 (visible hero, or visually hidden page title); author profile name is the h1 (#860). - Every template image has an alt decision; card, avatar, header and featurette images carry intrinsic width/height (#869). - Duplicate Google Fonts preconnects removed from the chatbot partial. - scripts/check_seo_html.py checks the built HTML for these rules and runs after the Hugo build in deploy.yaml. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011qVBTM5W7PENuS5gS1Nm7z
Contributor
|
Contributor
✅ Spell Check PassedNo spelling issues found when checking 42 changed file(s)! 🎉 |
Contributor
Author
|
✅ Staging Deployment Status This PR has been successfully deployed to staging as part of an aggregated deployment. Deployed at: 2026-09-02 22:22:19 UTC The staging site shows the combined state of all compatible open PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #865, #860, #869, #861. Related: #870 (duplicate preconnects, item 6).
What changes
Conditional Mermaid / Highlight.js (#865)
diagramandhighlightsite params default tofalse.site_head.htmldecides per page: front matter (highlight: true/diagram: true) wins; otherwise the library loads only when the page's Markdown content contains a code block (resp. a Mermaid block). Detection runs on.Content, so the cite modal's<pre><code class="tex hljs">on every page does not trigger it.defer; their only callers sit in academic.js's document-ready handler./manuscript/, forced via front matter because its code block lives in a headless section file); Mermaid loads on none; the homepage requests neither.Search index (#861)
/index.jsonlanded in Fix navbar search: restore missing fields so results, links, and full-text match #871. This PR adds the missing failure state: if the fetch fails, the overlay shows a message and the next search-open retries.index.jsonrequest on a cold homepage load; one request after opening search; a direct/?q=preregistrationURL renders results.Heading hierarchy (#860)
h2(same visual size via CSS).h1: a hero widget renders a visible one, otherwisewidget_page.htmlemits a visually hiddenh1from the page title (site title on the homepage). All section titles from widget partials areh2with unchanged size and divider.h1.h1drop from 5287 to 13. The remaining 13 are content-level#headings inside widget sections (community, mission, testimonials, publications, …) and shortcode-emittedh1s; those are content edits and left out here.Images (#869)
<img>now has an alt decision. The award logos incontent/awards/awards.mdgetalt=""because the adjacent text names the awarding organisation; the ELD CAMA diagram gets a descriptive alt.width/heightadded to announcement cards, list cards, resource cards, avatars, page-header featured images, the CC badge, and featurette images (via a newfunctions/static_img_dimspartial that reads static raster files at build time). CSS keeps those images fluid (height: auto). Homepage: 15 of 24 images now carry dimensions; the rest are the SVG logo, SDG badges in a shortcode, the chatbot icon and one content image.Cleanup
chatbot.html.Regression check
scripts/check_seo_html.py publicparses every built page and fails on: an<h1>Search</h1>, Mermaid/Highlight.js on the homepage, a library loaded on a page without a matching code block (or vice versa), or an<img>without an alt attribute. It also reports pages with zero or severalh1s and the homepage image dimension count. It runs after the Hugo build indeploy.yaml.Verified
Not in this PR
#859, #864, #866, #867, #868 need expert review or design decisions.
🤖 Generated with Claude Code